<template>
  <div>
    <!--内部邮件发件箱-->
    <el-table ref="multipleTable" :data="tableData.MailList" style="width: 100%">
      <el-table-column v-if="show" prop="pk_Mail" label="邮件ID" width="0">
      </el-table-column>
      <el-table-column prop="StatusNmae_CHS" label="状态" width="150">
      </el-table-column>
      <el-table-column prop="TypeNmae_CHS" label="类型"" width=" 150">
      </el-table-column>
      <el-table-column prop="MailTo" label="收件人" width="150">
      </el-table-column>
      <el-table-column prop="MailFrom" label="发件人" width="150">
      </el-table-column>
      <el-table-column prop="Subject" label="邮箱标题" width="200">
      </el-table-column>
      <el-table-column prop="SentDate" label="发送时间" width="200">
      </el-table-column>
      <el-table-column v-if="show" prop="Body" label="内容" width="0">
      </el-table-column>

      <el-table-column fixed="right" label="操作" width="200">
        <template slot-scope="scope">
          <el-button type="primary" @click="handleClick(scope.row)" size="small">查看</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-dialog title="邮件内容" :visible.sync="MailConent">
      <div v-html="Body">

      </div>
    </el-dialog>

    <el-row class="Resume_row_paging">
      <el-col :span="5">
        <br>
      </el-col>
      <el-col :span="12">
        <div><br /></div>
      </el-col>
      <el-col :span="7">
        <el-pagination background layout="prev, pager, next" :total="tableData.Count" :current-page.sync="AuditInfoPage"
          @current-change="MailPage" :page-size="5">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>
<style scoped>
.messageBox-prompt-test {
  width: 1000px;
}
</style>
<script>
export default {
  data () {
    return {
      tableData: {},
      AuditInfoPage: 1,
      AuditInfo: [],
      show: false,
      MailConent: false

    }
  }, methods: {
    handleClick (row) {
      this.MailConent = true
      this.Body = row.Body

    },
    MailPage () {
      this.$axios({
        url: '/HrApi/Mail/GetOutboxInfo',
        method: 'Get',
        params: {
          page: this.AuditInfoPage,
          limit: 5,
          MailFrom: this.$store.state.UserInfo.pk_User,
        }
      }).then(res => {
        this.tableData = res.data.data
      })
    }

  },
  mounted () {
    this.MailPage();
  }
}
</script>